package com.yc.sole.system.request;

import com.yc.sole.common.enums.CommonState;
import com.yc.sole.common.enums.MenuType;
import com.yc.sole.framework.validate.SaveGroup;
import com.yc.sole.framework.validate.UpdateGroup;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;

/**
 * Request对象
 *
 * @author yizuomin
 * @date 2023-03-26
 **/
@Data
public class MenuReq implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @NotNull(groups = {UpdateGroup.class})
    private Long id;
    /**
     * 菜单名称
     */
    @Length(max = 50, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String menuName;
    /**
     * 父级id
     */
    private Long parentId;
    /**
     * 菜单类型
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private MenuType menuType;
    /**
     * 路径
     */
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    @Length(max = 255, groups = {SaveGroup.class, UpdateGroup.class})
    private String path;
    /**
     * 图标
     */
    @Length(max = 50, groups = {SaveGroup.class, UpdateGroup.class})
    private String icon;
    /**
     * 状态
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private CommonState state;
    /**
     * 排序
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private Integer sort;
    /**
     * 是否自动创建增删改查权限字符
     */
    private boolean autoCreatePerm;
}
